package com.tramy.data.export;

import com.tramy.data.export.conf.DataSourceConfig;
import com.tramy.data.export.conf.MyBatisConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

/**
 * Created by honway on 2016/11/3.
 * 这里使用exclude排除掉了spring-boot的自动配置数据源
 * 因为数据源,都是我们手动配置的.如果不排除,会导致循环依赖的问题
 */
@SpringBootConfiguration
@MapperScan(basePackages = "com.tramy.data.export.mapper")
@EnableConfigurationProperties
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@Import({DataSourceConfig.class, MyBatisConfig.class})
@ComponentScan("com.tramy.data.export")
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class,args);
    }
}
